"use strict";
cc._RF.push(module, '77650wOFTxKIoo8+mVTrBgv', 'attention');
// scripts/O1ModuleRes/control/attention.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var gameConfig_1 = require("../../engines/configs/gameConfig");
var gameEngine_1 = require("../../engines/gameEngine");
var MainRoot_1 = require("../../Game/MainRoot");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var attention = /** @class */ (function (_super) {
    __extends(attention, _super);
    function attention() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    // LIFE-CYCLE CALLBACKS:
    // onLoad () {}
    attention.prototype.onEnable = function () {
        if (window['tt'] && gameConfig_1.default.DOUYIN_YUMAI == 1 && MainRoot_1.default.platName != "novelapp") {
            var Platname_1 = null;
            var self_1 = this;
            window['tt'].getSystemInfo({
                success: function (res) {
                    Platname_1 = res.appName;
                    if (Platname_1 != "Douyin") {
                        self_1.node.active = false;
                    }
                    window['tt'].checkFollowAwemeState({
                        success: function (res) {
                            console.log("调用成功", res);
                            if (res.hasFollowed) {
                                self_1.node.active = false;
                            }
                        },
                        fail: function (res) {
                            console.log("调用失败", res);
                        },
                    });
                },
                fail: function (res) {
                    console.log("getSystemInfo \u8C03\u7528\u5931\u8D25");
                    self_1.node.active = false;
                },
            });
        }
        else {
            this.node.active = false;
        }
    };
    attention.prototype.OnClickAttention = function () {
        gameEngine_1.default.getManagers().soundMgr.playSound('mainSound/anNiu').then();
        if (window['tt']) {
            var self_2 = this;
            window['tt'].openAwemeUserProfile({
                success: function (res) {
                    console.log(res);
                    if (res.hasFollowed) {
                        self_2.node.active = false;
                    }
                },
                fail: function (err) {
                    console.warn("失败---", err);
                }
            });
        }
    };
    attention = __decorate([
        ccclass
    ], attention);
    return attention;
}(cc.Component));
exports.default = attention;

cc._RF.pop();